package com.sunlands.qdcy.deskmate.client;

import com.sunlands.qdcy.deskmate.config.OauthFeignConfig;
import com.sunlands.qdcy.deskmate.vo.BusinessResult;
import com.sunlands.qdcy.deskmate.vo.feign.UserInfoVO;
import com.sunlands.qdcy.deskmate.vo.feign.VipSetMealVO;
import com.sunlands.qdcy.deskmate.vo.feign.VipUserVO;
import com.sunlands.qdcy.deskmate.vo.feign.VipVO;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author anjl
 * @date 2019/4/1716:45
 */
@FeignClient(value = "tz-user-center",configuration = OauthFeignConfig.class)
public interface UserCenterService {

    @RequestMapping(value = "/users/{id}", method = RequestMethod.GET)
    BusinessResult<UserInfoVO> getUserInfoById(@PathVariable("id") Long userId);


    @GetMapping("/vip/set-meal/{id}")
    BusinessResult<VipSetMealVO> getVipSetMeal(@PathVariable("id") Long id);

    @ApiOperation(value = "开通/续费vip")
    @PostMapping("/vip/open")
    BusinessResult<VipUserVO> openVip(@RequestBody VipVO vipVO);

    @ApiOperation(value = "关闭vip")
    @PostMapping("/vip/close")
    BusinessResult<VipUserVO> closeVip(@RequestBody VipVO vipVO);

    @GetMapping("/vip/set-meal/pay/list")
    BusinessResult<List<VipSetMealVO>> listVipSetMeal(@ApiParam(required = true) @RequestParam(value = "os") String os);

}
